New component: ha-expansion-panel#6789
Conversation
|
You should probably use a |
|
@bramkragten so I should extend |
No, not extend, just use it in your render. |
|
Should we use HA-card? Or should this be the guts of the functionality and can be outside of a |
src/components/ha-expansion-panel.ts
Outdated
| } | ||
|
|
||
| .summary-content { | ||
| margin: 12px 0; |
There was a problem hiding this comment.
Too much margin. Specifically on the bottom. The content is not close enough to the summary title
src/components/ha-expansion-panel.ts
Outdated
| line-height: 1.5; | ||
| letter-spacing: 0.00938em; | ||
| font-size: 0.9375rem; | ||
| font-family: "Roboto", "Helvetica", "Arial", sans-serif; |
There was a problem hiding this comment.
| line-height: 1.5; | |
| letter-spacing: 0.00938em; | |
| font-size: 0.9375rem; | |
| font-family: "Roboto", "Helvetica", "Arial", sans-serif; | |
| line-height: 1.2; | |
| text-overflow: ellipsis; | |
| overflow: hidden; |
There was a problem hiding this comment.
I think ellipsis needs display, white-space an width properties, ref: https://stackoverflow.com/a/7993098/965722
I have a problem with width because it needs to be calculated.
There was a problem hiding this comment.
I pulled your code and editted it. This is needed and I was able to add it.
Or you can just make it a lot and have the element using it do it :)
src/components/ha-expansion-panel.ts
Outdated
| margin: 12px 0; | ||
| display: flex; | ||
| flex-grow: 1; | ||
| transition: margin 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; |
There was a problem hiding this comment.
| transition: margin 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; | |
| transition: margin 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; | |
| overflow: hidden; |
| .summary { | ||
| display: flex; | ||
| padding: 0px 16px; | ||
| min-height: 48px; |
There was a problem hiding this comment.
actually its this that is too large that is making it not close enough to the content
|
We should use javascript to set the |
c459364 to
2c9f2da
Compare
|
I really like this Component. I already have a branch that is using it 😄 |
|
@zsarnett that's why I want this to be part of HA :) just need to polish this a bit more. |
|
Any update on this? Would love to be able to get this in so it can start to be used |
|
@zsarnett sadly no updates for now. I'll try to move things forward next week. |
|
I wouldn't use ha card. But all good. Just making sure it hasn't been forgotten |
single event Co-authored-by: Bram Kragten <mail@bramkragten.nl>
5ea366d to
228ff6b
Compare
src/components/ha-expansion-panel.ts
Outdated
|
|
||
| private _handleTransitionEnd() { | ||
| if (this.expanded) { | ||
| this._container.style.height = "auto"; |
There was a problem hiding this comment.
This works right?
| this._container.style.height = "auto"; | |
| this._container.style.removeProperty("height"); |
There was a problem hiding this comment.
yes, this works perfectly. I've simplified the logic a bit thanks to this.
The last thing I'd like to remove is setTimeout, but collapse doesn't work without this.
|
We can merge this as soon as we have implemented it somewhere. |
I want to implement this in the time condition editor. Also, @zsarnett had usage for this component. |
|
This is awesome! I also have use for it -- I want to make sequence steps collapsible and show their |
|
Why are we collapsing parts of a condition instead of the whole condition? And when we collapse a condition, we should make sure that a summary of that condition is put in the name. Ie "Time trigger at 10:01" Once we have such summaries, we can just automatically collapse everything, making it easier to see what's going on in an automation. |
|
@balloob this PR only adds a new component. No usage. I'm planning to add usage in a separate PR. |
Breaking change
Proposed change
This adds a new component
ha-expansion-panel. I want to use it with the time condition editor.Supported parameters:
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: